package io.renren.sf.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.sf.dao.RecommendSteleCalligraphyCollectionDao;
import io.renren.sf.entity.RecommendSteleCalligraphyCollectionEntity;
import io.renren.sf.service.RecommendSteleCalligraphyCollectionService;


@Service("recommendSteleCalligraphyCollectionService")
public class RecommendSteleCalligraphyCollectionServiceImpl extends ServiceImpl<RecommendSteleCalligraphyCollectionDao, RecommendSteleCalligraphyCollectionEntity> implements RecommendSteleCalligraphyCollectionService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<RecommendSteleCalligraphyCollectionEntity> page = this.page(
                new Query<RecommendSteleCalligraphyCollectionEntity>().getPage(params),
                new QueryWrapper<RecommendSteleCalligraphyCollectionEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<RecommendSteleCalligraphyCollectionEntity> queryCollections(Integer curPage, Integer pageSize, Integer rtype) {
        curPage = (curPage-1) * pageSize;
        return this.baseMapper.queryCollections(curPage, pageSize, rtype);
    }

    @Override
    public Integer queryCollectionsNum(Integer rtype) {
        return this.baseMapper.queryCollectionsNum(rtype);
    }

}